% Script to run the saccade experiment

clear classes

Exp = ET_SS_FF();

% Screen size
%--------------------------------------------------------------------------
Exp.scn.w = 1680;
Exp.scn.h = 1050;
Exp.scn.wcm  = 47.7;
Exp.scn.hcm = 29.8;
Exp.scn.dist = 61.0;
Exp.scn.mon = 0;


% Exp.scn.w = 1920;
% Exp.scn.h = 1200;
% Exp.scn.wcm  = 52;
% Exp.scn.hcm = 32.5;
% Exp.scn.mon = 0;



% Creates an instance of the eye link manager
%--------------------------------------------------------------------------

Exp.el_pointer = EYELINK_EXP(Exp);

Exp.el_pointer.screen_phys_coords = [-Exp.scn.wcm/2,Exp.scn.hcm/2,Exp.scn.wcm/2,-Exp.scn.hcm/2];
Exp.el_pointer.screen_pixel_coords = [0,0,Exp.scn.w,Exp.scn.h];
Exp.el_pointer.screen_distance = [585,680];
% Configure manually the final ini file.


% Which blocks are displayed
%--------------------------------------------------------------------------

Exp.prepareBlocks([2]);
Exp.prepareTrials(400,[0,1.5])

Exp.bc(1).bg = [0 78 0];
Exp.bc(2).bg = [0 0 0];
Exp.bc(3).bg = [0 78 0];

Exp.bc(1).tc = [109 0 0];
Exp.bc(2).tc = [200 200 200];
Exp.bc(3).tc = [109 0 0];


Exp.fix.w = 0.5;
Exp.fix.h = 0.5;
Exp.fix.shape = 'FillRect';
Exp.target.w = 0.5;
Exp.target.h = 0.5;
Exp.target.shape = 'FillRect';
Exp.text_size = 40;
Exp.scn.refresh_rate = 60.146833;

% 30 trials before recalibrating.

Exp.recal = 30;

% Time for behavioral response

Exp.beh_t = 2;

% Turn eye link on
%--------------------------------------------------------------------------
Exp.EyeLink = 0;
Exp.fix_win = 2*[-30,30,30,-30]; % left,up,right,down. Pixels

try 
    Exp.runScreen()
catch Err
    Exp.exit();
    rethrow(Err)
end
    
%Exp.bh_r
